﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class controls_searchFormControl : System.Web.UI.UserControl
{
    public String sTown1 { get { return town1.Text; } set { town1.Text = value; } }
    public String sTown2 { get { return town2.Text; } set { town2.Text = value; } }
    public String sTown3 { get { return town3.Text; } set { town3.Text = value; } }
    public String sTown4 { get { return town4.Text; } set { town4.Text = value; } }
    public String sTown5 { get { return town5.Text; } set { town5.Text = value; } }
    public Int32 sFromPrice { get { return Int32.Parse(fromPrice.SelectedValue); } set { fromPrice.SelectedValue = value.ToString(); } }
    public Int32 sToPrice { get { return Int32.Parse(toPrice.SelectedValue); } set { toPrice.SelectedValue = value.ToString(); } }
    public String sObjectType { get { return objectType.SelectedValue; } set { objectType.SelectedValue = value; } }
    public String sHouseType { get { return houseType.SelectedValue; } set { houseType.SelectedValue = value; } }
    public String sBuildingType { get { return buildingType.SelectedValue; } set { buildingType.SelectedValue = value; } }
    public String sNewBuilding { get { return newBuilding.SelectedValue; } set { newBuilding.SelectedValue = value; } }
    public String sBuildingPeriod { get { return buildingPeriod.SelectedValue; } set { buildingPeriod.SelectedValue = value; } }
    public String sNrRooms { get { return nrRooms.SelectedValue; } set { nrRooms.SelectedValue = value; } }
    public String sLivingSurface { get { return livingSurface.SelectedValue; } set { livingSurface.SelectedValue = value; } }
    public String sLandSurface { get { return landSurface.SelectedValue; } set { landSurface.SelectedValue = value; } }
    public String sLocation { get { return location.SelectedValue; } set { location.SelectedValue = value; } }
    public String sOfferTime { get { return offerTime.SelectedValue; } set { offerTime.SelectedValue = value; } }
    public Boolean hasGarden { get { return garden.Checked.Equals("True"); } set { garden.Checked = value; } }

    public void Button1_Click(object sender, System.EventArgs e)
    {
        if (Page.IsValid)
        {
            Context.Items.Add("search", this);
            Server.Transfer("searchresults.aspx");
        }
    }
}
